<template>
  <view class="inforamtion" style="display: flex;">
  	<view >
  		<view class="option" style="width: 520rpx;">
  			<view class="lf">生产团队</view>
  			<view class="rl">{{filterMultiDictText(this.dictOptions['productTeam'], item.productTeam + '')}}</view>
  		</view>
  		<view class="option" style="width: 520rpx;">
  			<view class="lf">业务名称</view>
  			<view class="rl">{{ item.categoryName }}</view>
  		</view>
			<view class="option" style="width: 520rpx;">
  			<view class="lf">任务说明</view>
  			<view class="rl">{{ item.taskDesc }}</view>
  		</view>
			<!-- <view class="option" style="width: 520rpx;">
  			<view class="lf">款项分配占比(%)</view>
  			<view class="rl">{{ item.paymentRate }}</view>
  		</view>
			<view class="option" style="width: 520rpx;">
  			<view class="lf">款项分配金额(元)</view>
  			<view class="rl">{{ item.paymentMoney }}</view>
  		</view> -->
			<!-- <view class="option" style="width: 520rpx;">
  			<view class="lf">款项节点说明</view>
  			<view class="rl">{{ item.kxjdsm }}</view>
  		</view> -->
  	</view>
  	<view  style="flex: 1; display: flex; align-items: center; justify-content: flex-end;" v-if="!disabled">
  		<u-icon name="edit-pen-fill" color="#2979ff" size="20" @click="handleEidtForm(item)"></u-icon>
  		<u-line  direction="col" length="20" v-if="collectMoneyStatus != '已生成'"></u-line>
  		<u-icon name="trash-fill" color="#2979ff" size="20" @click="handleRemoveForm(item)" v-if="collectMoneyStatus != '已生成'"></u-icon>
  	</view>
  </view>
</template>

<script>
import { filterMultiDictText, initDictOptions } from '@/utils/JDictSelectUtil.js'
export default {
  name: 'planTaskFormInfo',
  props: {
    index: {
      type: Number,
      default: null,
    },
    item: {
      type: Object,
      default: () => ({}),
    },
		disabled: {
			type: Boolean,
			default: false
		},
		showKxxx: {
			type: Boolean,
			default: false
		},
		collectMoneyStatus: {
			type: [String, Number],
			default: ''
		}
  },
	data() {
	  return {
			dictOptions:{},
			filterMultiDictText,
			initDictOptions
	  }
	},
	created() {
		this.initDictConfig()
	},
  methods: {
		initDictConfig() {
		  initDictOptions('erp_omc_team_manager,alias_name,id').then((res) => {
				if (res.success) {
					this.$set(this.dictOptions, 'productTeam', res.result)
				}
			})
		},
    handleCopyForm(item) {
      this.$emit('copy', [item, this.index])
    },
    handleEidtForm(item) {
      this.$emit('edit', [item, this.index])
    },
    handleRemoveForm(item) {
      uni.showModal({
        content: '确定删除吗？',
        success: (res) => {
          if (res.confirm) {
            this.$emit('remove', item)
          }
        },
      })
    },
  },
}
</script>

<style lang="scss" scoped>
	.inforamtion{
		margin-top: 10rpx;
		padding: 10rpx;
		border-radius: 15rpx;
		box-shadow: 0px 4px 20px 0px rgba(0,0,0,0.1);
	}
	
</style>
